home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
651-660
/
656
/
surfaceplot
/
surfaceplot.doc
< prev
next >
Wrap
Text File
|
1995-03-15
|
5KB
|
134 lines
SURFACEPLOT v2.0
AUTHOR
"Kaliffen" or "The Caliph" alias
Ole Bak Jensen
Carl Blochsgade 31 4th
DK-8000 Århus C
Denmark
DISTRIBUTION TERMS
Distribute freely, but please DON'T discard the additional files (examples,
documentation, icon etc.). SurfacePlot is ColaWare! (which ISN'T a new
concept). If you like the program, then send me something, preferably a
Coke or, if that's too bulky, your own programs, a PD disk, a postcard or
whatever you find appropriate.
DESCRIPTION
SurfacePlot is a tool for drawing 3-dimensional parametrized surfaces on
the screen. I made it for visualizing the various surfaces used in a
mathematics-course called
differential geometry
.
The program is fun to play with, even if you aren't interested in math.
HOW TO USE
The program uses a hires interlaced screen. Unfortunately interlaced screens
cause some flicker on standard Amiga displays, but the pictures are much
nicer this way. The program will run on both PAL and NTSC machines, always
using the full screen height.
On the left side of the display is an area for drawing the function. On the
right side you type in all the parameters.
Function
You type in three seperate functions for the X, Y and Z coordinates, namely
x(u,v), y(u,v) and z(u,v). u and v are parameters, and you must supply their
boundaries by filling in the fields
low
,
high
and
step
for both parameters.
Parameters
When the surface is drawn, the parameter u will run from
u_low
to
u_high
in steps of
u_step
, and for each of u's values the parameter v will run from
v_low
to
v_high
in steps of
v_step
. WARNING: This means, if you double
the interval for both parameters, the number of calculations is quadrubled,
thus taking four times as long to calculate (and taking four times as much
memory). Be careful with the parameters!
Drawing procedure
First all the points on the surface are calculated. Each square on the
surface consists of four of these points. After calculating, the squares
are sorted after depth. Then the squares are drawn on the screen, in depth
decreasing order. This procedure ensures a sort of "hidden line" effect.
You can abort drawing with the
Esc
key.
Rotation and zoom
You can adjust the viewpoint by changing rotation and a zoom-factor. With a
(x,y,z)-rotation of (0,0,0), the viewpoint is as follows: The x-axis is
horizontal, the y-axis vertical and the z-axis goes
into
and
out of
the
screen.
If the rotation is changed to something, say (45,67,23), this happens: First
the surface and the axes are rotated 45 degrees around the x-axis. Then 67
degrees around the y-axis (that is, the OLD y-axis, before the x-rotation).
Third a rotation of 23 degrees around the z-axis is performed (also the OLD
z-axis). This system is a bit hard to use at first, but if you make a few
tests, drawing only the axes, you'll get the idea.
A rotation of (-130,-130,34) results in a nice view, looking on the positive
part of the 3D space with z-axis up, y-axis horizontal and x-axis for depth.
(This is a bit like the view used in most mathbooks).
The zoom-factor controls the distance to the surface. This is easy to use:
Use large zoom-factor for large surfaces, small zoom-factor for small ones.
Selection
:
You can select what is drawn by toggling the
axes
,
half
and
func
gadgets.
When
half
is active only the positive parts of the axes are drawn.
Axes
You must supply the length (of the positive half) and the distance between
tics.
Menus
In the Project menu, you can select About and Quit. With the settings menu
you can change the screen colors. You can also save and load the settings.
To load the examples, select
load settings
, and use the file-requester to
select one of the files in the examples-directory.
When SurfacePlot is started, it loads
s:SurfacePlot.config
as settings.
If this file doesn't exist, a default will be used. You can save your own
favourite startup-settings by saving the settings to this file.
With the Picture menu you can save the entire screen as an IFF file.
Hints
Pick the About-item in the program for more hints. Good luck!
REQUIREMENTS
SurfacePlot uses the excellent Req and IFF libraries, which can be
found on various databases. It won't run without the files
req.library
and
iff.library
in
libs:
directory. The standard
mathtrans.library
is also
required in
libs:
.
I have used req.library v2.2 and iff.library v18.5. I don't know if any
errors will occur if older versions are used.
BUGS
Let me know if you encounter errors/gurus, or have ideas for future updates.
I know the program isn't fast, but that's just a pity for now. Perhaps I'll
look into that in the future.
THANKS TO
Mr. Who??? for ideas, testing etc. Sweet Emmylou, I stole the graffunk module
from your program
graf
. Hope it's allright.
Ole Bak Jensen, Denmark